<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <!-- <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no,minimal-ui"> -->
    <meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes" />
    <title>Document</title>
    <link rel="stylesheet" href="__STATIC__/community/css/base.css">
    <link rel="stylesheet" href="__STATIC__/community/font/iconfont.css">
    <link rel="stylesheet" href="__STATIC__/community/css/css/OSChina.css">
    <script src="__STATIC__/community/js/jquery-3.1.0.min.js"></script>
    <!-- <script src="__STATIC__/community/js/js.js"></script> -->
</head>
<body>
    <div class="layout">
        <div class="typeP_area">
            <!-- 头像 -->
            <div class="head">
                <p class="head1">
                    <img src="{$card_details.head_portrait}" alt="">
                </p>
                <p class="head2">
                    <span class="hotpink">{$card_details.username}</span><br>
                    <span class="tems">{$card_details.ctime}</span>
                </p>
                <p class="head3">楼主</p>
            </div>
            <div class="refuel">
              <span>{$card_details.title}</span>
            </div>
            <div class="information">
                <p>
                    {$card_details.main_txt}
                </p>
            </div>

                <div class="tupian">
                    {if condition="$card_details.pic_h neq null"}
                    <p class="images1">
                        <img src="{$card_details.pic_h}" alt="">
                    </p>
                    {/if}
                    {if condition="$card_details.pic_h2 neq null"}
                    <p class="images1">
                        <img src="{$card_details.pic_h2}" alt="">
                    </p>
                    {/if}
                    {if condition="$card_details.pic_h3 neq null"}
                    <p class="images1">
                        <img src="{$card_details.pic_h3}" alt="">
                    </p>
                    {/if}
                    <!-- 点赞 -->
                    <!--<div class="like">-->
                        <!--<img onclick="card_like()" src="{$zan_id}" alt="" class="zan">-->
                    <!--</div>-->
                    <div class="like" onclick="card_like()">
                        <img src="{$zan_id}" alt="" class="zan">
                        <p class="somebody">喜欢</p>
                    </div>
                    <div class="people">
                       <p><span class="xuxian">——<span class="yanse">{$card_details.num_like}</span> 喜欢——</span></p>
                    </div>
                    <!-- 点赞 -->
                    <!--<div class="figure">-->
                        <!--{volist name="user_photo" id="vo"}-->
                        <!--<p class="permutation">-->
                            <!--<img src="{$vo.head_portrait}" alt="">-->
                        <!--</p>-->
                        <!--{/volist}-->
                    <!--</div>-->
                </div>
            </div>
        </div>   
</body>
<script>
    //帖子点赞
    function card_like(){
        // alert(1);
        var num = $(".yanse").text();
        var uid = '{$uid}';
        var id = '{$card_details.id}';
        var pt = '{$pt}';
        if(uid == '0'){
            if(pt == 1){
                // alert('android.jump_login()');
                var id = '1';
                android.jump_login(id);
            }else{
                var id = '1';
                // window.location.href='#{"do":"jump_login","id":"'+id+'"}';
                // window.webkit.messageHandlers.lwdkit.postMessage({'action':'jump_login','id':id});
            }
        }else{
            var url = "/api/community/click_card_h5?id="+id+"&uid="+uid;
            $.get(url,function(res){
                if(res.code == 2){
                    $('.zan').attr('src','/static/community/images/1.png');
                    $('.yanse').text(parseInt(num) - 1);
                }
                if(res.code == 1){
                    $('.zan').attr('src','/static/community/images/2.png');
                    $('.yanse').text(parseInt(num) + 1);
                }
            });
        }

    }
</script>
</html>